package com.deng.common.dao.impl;

import java.sql.Connection;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;

import com.deng.common.SQLHelper;
import com.deng.common.dao.IDutyType;
import com.deng.common.vo.DutyTypeVo;

public class DutyTypeImpl extends SQLHelper 
			implements IDutyType{

	
	public List<DutyTypeVo> getAllDutyType() {
		try{
			List l = new ArrayList<DutyTypeVo>();
			Connection conn = getConnect();
			ResultSet rs = queryData(conn,
					"select * from DICT_DUTY_TYPE order by id");
			
			while(rs.next()){
				DutyTypeVo vo = new DutyTypeVo();
				vo.id = rs.getInt("id");
				vo.name = rs.getString("name");
				l.add(vo);
			}
			freeConnection(conn);
			return l;
		}catch(Exception ex){
			ex.printStackTrace();
		}
		return null;
	}

	public DutyTypeVo getDutyTypeById() {
		// TODO Auto-generated method stub
		return null;
	}

}
